package org.jfk.core.utils;

import org.apache.commons.beanutils.PropertyUtils;

import com.jfinal.plugin.activerecord.Model;

public class BeanKit {
	public static Object getPropertyValue(Object bean, String propertyName){
		if (bean instanceof Model){
			Model m = (Model) bean;
			return m.get(propertyName);
		}
		
		try {
			return PropertyUtils.getProperty(bean, propertyName);
		} catch (Exception e) {
			return null;
		}
	}
}
